package clinsistem.c.repositorio;
import java.sql.*;

public class ConexaoBD {
	private static Connection con;
	
	private ConexaoBD () {
		
	}
	
	public static Connection getInstance() throws Exception {
		if (con == null) {
			Class.forName(ConfigBD.forname);
			
			try {
				
				con = DriverManager.getConnection(ConfigBD.url, ConfigBD.user, ConfigBD.senha);
				
			} catch (Exception e) {
				e.printStackTrace();
				throw new Exception();
			}
		}
		return con;
	}
}
